<?php
/* @file submit-problem.php
 * @author Liuexp
 * @description php interface for submit problem
 */


require_once("helper.php");
if(!InGroup(GROUP_SUBMIT_PROBLEM)){
	MsgBox(ACCESS_DENIED);
	exit();
}
	$volume_name=$_GET['volume'];
	$name=$_GET['problem'];
	$bean=R::dispense("record");
	$bean->volume_name=$volume_name;
	$bean->problem_name=$name;

	$bean->import($_POST,"sharetronix_user_id,language_name,code,submit_time");
	if(!isValidSubmit($bean))MsgBox(INVALID_SUBMIT);
	else {
		try{
			R::store($bean);
		}
		catch(Exception $e)
		{
			//TODO
		}
	}
